program multPro;
const
    max = 15005;
    LL = 15000;
type
    arr = array[0..max]of longint;
var
    m, p, l, lret:longint;
    ret, one: arr;
procedure print(var a : arr; la : longint);
var i : longint;
begin
    for i := la-1 downto 0 do
        write(a[i]);
    writeln();
end;
procedure mult(var a:arr; b : arr; var la : longint; lb : longint);
var
    tmp : arr;
    i, j :longint;
begin
    for i := 0 to max do tmp[i] := 0;
    for i := 0 to la-1 do
        for j := 0 to lb-1 do
            begin
                if i+j <= LL then
                    tmp[i+j] := tmp[i+j] + a[i]*b[j];
            end;
    for i := 0 to la+lb-3 do
        begin
            if i > LL then break;
            tmp[i+1] := tmp[i+1] + tmp[i] div 10;
            tmp[i] := tmp[i] mod 10;
        end;
    la := la+lb-1;
    if la > LL then la := LL;
    while (tmp[la-1] >= 10) and (la <= LL) do
        begin
            tmp[la] := tmp[la] + tmp[la-1] div 10;
            tmp[la-1] := tmp[la-1] mod 10;
            inc(la);
        end;
    for i := 0 to la-1 do a[i] := tmp[i];
end;
begin
    read(m, p);
    l := 0;
    while m > 0 do
        begin
            one[l] := m mod 10;
            m := m div 10;
            inc(l);
        end;
    ret[0] := 1;
    lret := 1;
    while p > 0 do
        begin
            if p mod 2 = 1 then
                mult(ret, one, lret, l);
            mult(one, one, l, l);
            p := p div 2;
        end;
    print(ret, lret);
end.
